#include <iostream>
using namespace std;

class AA{
public:
	AA(int i,int j)
	{
		this->i=i;
		this->j=j;
	}

	friend ostream& operator<<(ostream &out,AA &aa);
	friend istream& operator>>(istream &in,AA &aa);
private:
	int i;
	int j;
};

ostream& operator<<(ostream &out,AA &aa)
{
	out<<"i: "<<aa.i<<" j:"<<aa.j<<endl;
	return out;
}
istream& operator>>(istream &in,AA &aa)
{
	in>>aa.i>>aa.j;
	if(!in) //if input invilad
	{
		aa=AA(0,0);
	}
	return in;
}

int main()
{
	AA aa(520,1314);
	cout<<aa;
	cout<<"please input:";
	cin>>aa;
	cout<<aa;
	return 0;
}